import 'package:flutter/material.dart';
import 'package:flutter_reader/app_navigator.dart';
import 'package:flutter_reader/model/novel.dart';
import 'package:flutter_reader/res/colors.dart';
import 'package:flutter_reader/utils/screen.dart';

class NovelDetailToolbar extends StatelessWidget {
  final Novel novel;
  NovelDetailToolbar(this.novel);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(bottom: Screen.bottomSafeHeight),
      decoration: BoxDecoration(
          color: Colors.white,
          boxShadow: [BoxShadow(color: Color(0x22000000), blurRadius: 8)]),
      height: 50 + Screen.bottomSafeHeight,
      child: Row(
        children: [
          Expanded(
            child: Center(
              child: Text(
                '加书架',
                style: TextStyle(fontSize: 16, color: MyColors.primary),
              ),
            ),
          ),
          Expanded(
            child: GestureDetector(
              onTap: () =>
                  AppNavigator.pushReader(context, novel.firstArticleId),
              // AppNavigator.pushReader(context, novel.firstArticleId),
              child: Container(
                height: 40,
                decoration: BoxDecoration(
                    color: MyColors.primary,
                    borderRadius: BorderRadius.circular(5)),
                child: Center(
                  child: Text(
                    '开始阅读',
                    style: TextStyle(fontSize: 16, color: Colors.white),
                  ),
                ),
              ),
            ),
          ),
          Expanded(
            child: Center(
              child: Text(
                '下载',
                style: TextStyle(fontSize: 16, color: MyColors.primary),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
